package com.cetc39.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.cetc39.bean.ProjectField;
import com.cetc39.dao.ProjectFieldDao;

public class ProjectFieldDaoImpl extends HibernateDaoSupport implements ProjectFieldDao {

	@Override
	public void save(ProjectField pf) {
		this.getHibernateTemplate().save(pf);
	}

	@Override
	public void update(ProjectField pf) {
		this.getHibernateTemplate().saveOrUpdate(pf);
	}

	@Override
	public void delete(int id) {
		ProjectField pf = this.getHibernateTemplate().get(ProjectField.class, id);
		this.getHibernateTemplate().delete(pf);
	}

	@Override
	public List<?> findAll() {
		List<?> pfList = this.getHibernateTemplate().find("FROM ProjectField");
		return pfList;
	}

	@Override
	public ProjectField findById(int id) {
		ProjectField pf = this.getHibernateTemplate().get(ProjectField.class, id);
		return pf;
	}

}
